X=g++
DIR_SRC=./src
DIR_MAIN=$(DIR_SRC)/main
DIR_UDP=$(DIR_SRC)/udp
DIR_WMN=$(DIR_SRC)/wmn
DIR_DOG=$(DIR_SRC)/dog

SRC=$(wildcard ${DIR_SRC}/*.cpp)\
	$(wildcard ${DIR_MAIN}/*.cpp)\
	$(wildcard ${DIR_WMN}/*.cpp)\
	$(wildcard ${DIR_UDP}/*.cpp)\
	$(wildcard ${DIR_DOG}/*.cpp)\
	$(wildcard ${DIR_SRC}/algorithm/*.cpp)
#SRCS=$(wildcard ${DIR_SRC}/*.cpp)
#SRCS_MAIN=$(wildcard ${DIR_MAIN}/*.cpp)
#SRCS_WMN=$(wildcard ${DIR_WMN}/*.cpp)
#SRCS_UDP=$(wildcard ${DIR_UDP}/*.cpp)
#SRCS_DOG=$(wildcard ${DIR_DOG}/*.cpp)
#DIR=$(notdir $(SRCS) $(SRCS_MAIN) $(SRCS_WMN) $(SRCS_UDP) $(SRCS_DOG))
OBJS=$(SRC:.cpp=.o)
#OBJS=$(patsubst %.cpp,%.o,$(DIR)) 
EXEC=Hudp

all:
	@echo $(SRC)
	@echo $(SRCS_MAIN)
	@echo $(DIR)
	@echo $(OBJS)
build:$(OBJS)
	$(X) -o $(EXEC) $(OBJS)
.cpp.o:
	$(X) -o $@ -c $<

clean:
	rm -rf $(OBJS)

